package triannon.client.sprites.renderer;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Stroke;

public class PreSelectionRenderer {
	private static final Stroke STROKE = new BasicStroke(2,
			BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL, 0, new float[] { 8.0f,
					5.0f }, 0.0f);
	private static final Color SELECTION_COLOR = new Color(200, 200, 200, 200);

	public void paint(Graphics2D g, int x, int y, int width, int height) {
		Stroke orgStroke = g.getStroke();
		g.setStroke(STROKE);
		g.setColor(SELECTION_COLOR);

		if (width <= height) {
			g.drawOval(x + 2, y + 2 + height / 8, width - 4, ((height / 8) * 7) - 4);
		} else {
			g.drawOval(x + 2, y + 2, width - 4, height - 4);
		}

		g.setStroke(orgStroke);
	}
}
